package com.zego.wawaji.ui.play;

import android.widget.ImageView;
import android.widget.TextView;

import com.zego.wawaji.R;
import com.zego.wawaji.third.image.ImageLoader;
import com.zego.wawaji.ui.base.recycler.BaseRecyclerViewAdapter;
import com.zego.wawaji.ui.base.recycler.BaseRecyclerViewHolder;
import com.zego.wawaji.ui.play.bean.LuckyUser;
import com.zego.wawaji.wawaji_client.AppTinkerLike;

/**
 * 最近游戏成功记录
 * Created by Su on 2017/12/8.
 */
public class PlayFootAdapter extends BaseRecyclerViewAdapter<LuckyUser> {
    @Override
    public int[] getItemLayouts() {
        return new int[]{R.layout.suc_list_item};
    }

    @Override
    public void onBindRecycleViewHolder(BaseRecyclerViewHolder viewHolder, int position) {
        LuckyUser user = getItem(position);

        ImageView head = viewHolder.findViewById(R.id.user_head);
        TextView name = viewHolder.findViewById(R.id.user_name);
        TextView timeInfo = viewHolder.findViewById(R.id.time_info);

        ImageLoader.loadRoundAvatar(AppTinkerLike.getContext(), user.getUserHead(), head);
        name.setText(user.getUserName());
        timeInfo.setText(user.getCreatTime());
    }

    @Override
    public int getRecycleViewItemType(int position) {
        return 0;
    }
}